#ifndef KINEMATICS_H
#define KINEMATICS_H

#include "zuc/nml_intf/zucpos.h" /* ZucPose */

/*
  The type of kinematics used.
  
  KINEMATICS_IDENTITY means that the joints and world coordinates are the
  same, as for slideway machines (XYZ milling machines). The ZUC will allow
  changing from joint to world mode and vice versa. Also, the ZUC will set
  the actual world position to be the actual joint positions (not commanded)
  by calling the forward kinematics each trajectory cycle.

  KINEMATICS_FORWARD_ONLY means that only the forward kinematics exist.
  Since the ZUC requires at least the inverse kinematics, this should simply
  terminate the ZUC.

  KINEMATICS_INVERSE_ONLY means that only the inverse kinematics exist.
  The forwards won't be called, and the ZUC will only allow changing from
  joint to world mode at the home position.

  KINEMATICS_BOTH means that both the forward and inverse kins are defined.
  Like KINEMATICS_IDENTITY, the ZUC will allow changing between world and
  joint modes. However, the kins are assumed to be somewhat expensive
  computationally, and the forwards won't be called at the trajectory rate
  to compute actual world coordinates from actual joint values.
*/

typedef enum
{
    KINEMATICS_IDENTITY = 1, /* forward=inverse, both well-behaved */
    KINEMATICS_FORWARD_ONLY, /* forward but no inverse */
    KINEMATICS_INVERSE_ONLY, /* inverse but no forward */
    KINEMATICS_BOTH          /* forward and inverse both */
} KINEMATICS_TYPE;

extern int getToolMovPos(const ZucPose* world, const ZucPose* pos, ZucPose* out);

#endif
